package com.bolt.auth.security.admin.biz.sys.repository;

import com.bolt.auth.admin.api.sys.entity.AreaEntity;
import com.bolt.support.spring.jpa.repository.BasicJpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* Auto Generate Javadoc
* @author
* 日期:2018-02-07 16:11:28
* 中国行政地区表 Repository
* */
@Repository
public interface AreaRepository extends BasicJpaRepository<AreaEntity,Long> {

     @Query("from AreaEntity where pid = 0 order by areaCode ")
     List<AreaEntity> findRoot();

    AreaEntity findByAreaCode(String areaCode);

    List<AreaEntity> findByPid(Long pid);

}